<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>index3</title>
	</head>
	<body>
		<div id='app'>
			
			<child-component>
				<navigation-link url="https://www.baidu.com">
					百度一下,你就知道
				</navigation-link>
				<h2 slot="header">标题</h2>
				    <p>正文内容</p>
					<p>更多正文内容</p>
				<div slot="footer">底部信息</div>
			</child-component>
		</div>
	</body>
	<script>
		Vue.component('navigation-link',{
			pros:['url'],
			template:`
			<a 
			v-bind:href="url"
			class="nav-link"
			>
			  <slot></slot>
			</a>
			`
		})
		Vue.component('child-component',{
			template:`
			<div>
			  <div class="header">
			    <slot name="header"></slot>
			  </div>
			  <slot>
				<p>如果父组件没用插入内容,我将作为默认出现</p>
			  </slot>
			  <div class="footer">
			    <slot name="footer"></slot>
			  </div>
			`
		})
		let app=new Vue({
			el:'#app',
			data{
				
			},
			methods:{
				
			}
		})
	</script>
</html>
